<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.class{
				color: red;
				font-size: 30px;
			}
		</style>
		<script type="text/javascript">
			function changeCSS(){
				/* document.getElementById("p1").style.color="blue";
				document.getElementById("p1").style.fontSize="30px"; */
				
				document.getElementById("p1").className = "class"
			}
		</script>
	</head>
	<body>
		<p id="p1">刘备</p>
		<input type="button" value="改变" onclick="changeCSS()"/>
	</body>
</html>
